package com.yc.simplefactory1;

import com.yc.bean.ICourse;
import com.yc.bean.JavaCourse;

public class TestSimpleFactory {
    public static void main(String[] args) {
        //功能高内聚低耦合
//        CourseFactory courseFactory = new CourseFactory();
//        ICourse course = courseFactory.create("java");
//        course.record();

        //方案二
//        ICourse course2 = CourseFactory.create2("com.yc.bean.JavaCourse");
//        course2.record();

        //方案三
        ICourse course3 = CourseFactory.create3(JavaCourse.class);
        course3.record();
    }
}
